﻿using System.Collections.Specialized;
using Melee.Controller.Handlers;
using Melee.Controller.Storage;
using Melee.Controller.Storage;

namespace Melee.Controller.Request
{
    public class WebRequest
    {
        private AsyncResult m_AsyncResult = null;
        public AsyncResult AsyncResult
        {
            get { return m_AsyncResult; }
            set { m_AsyncResult = value; }
        }

        private UserCookie m_Cookie = null;
        public UserCookie Cookie
        {
            get { return m_Cookie; }
            set { m_Cookie = value; }
        }

        public IHttpStorage Storage
        {
            get { return HttpStorageFactory.GetStorage(AsyncResult.Context); }
        }

        public bool IsAuthenticated
        {
            get { return AsyncResult.Context.Request.IsAuthenticated; }
        }

        public string RequestedURL
        {
            get { return AsyncResult.Context.Request.Url.ToString(); }
        }

        public NameValueCollection QueryArguments
        {
            get { return AsyncResult.Context.Request.Params; }
        }
    }
}
